<?php $this->pageTitle = "Login" . $agency->name; ?>
<?php Yii::app()->publishAndRegisterCssFile($_SERVER['DOCUMENT_ROOT'] . '/css/app.account.login.custom.css'); ?>

<div class="main_container container_16">
	<div class="flat_area">
		<div class="grid_16">
			<div id="login_box_wrapper" class="relative">
				<div id="agency-login-header" class="align-center">
					<?php if ($agency->logo): ?>
						<img src="<?php echo $agency->logo; ?>" alt="<?php echo $agency->name; ?>" class="agency-logo" style="max-width: 400px;" /><br/>
					<?php endif; ?>
					<h1>Welcome to <?php echo ucwords(strtolower($agency->name)); ?></h1>
				</div>

				<?php
				$form = $this->beginWidget('CActiveForm', array(
					'id' => 'login-form',
					'enableAjaxValidation' => true,
					'htmlOptions' => array(
						'class' => 'form',
					)
				));
				?>
				<?php echo $form->errorSummary($model); ?>
				<div id="login_box" class="section">
					<div class="block">
						<h2>Login</h2>
						<label class="fields">
							<strong>Username:</strong>
							<?php echo $form->textField($model, 'username', array('class' => 'indent', 'autocomplete' => 'off')); ?>
						</label>
						<label class="fields">
							<strong>Password</strong>
							<?php echo $form->passwordField($model, 'password', array('class' => 'indent', 'autocomplete' => 'off')); ?>
						</label>
						<label class="fields">
							<strong>Login as</strong>
							<?php
							echo $form->radioButtonList($model, 'app', array(
								'TopAchiever' => 'Salesperson',
								'Prestige' => 'Agency',
									), array('class' => '', 'autcomplete' => 'off'));
							?>
						</label>
						<div class="fields">
							<?php echo $form->checkBox($model, 'rememberMe', array('checked' => true)); ?><label for="LoginForm_rememberMe">Auto-login in future.</label>
							<?php echo CHtml::link('Forget your Password?', array('account/forgetPassword', 'shortname' => $shortname), array('class' => 'blue link float-right')); ?>
						</div>
						<button class="button_colour" type="submit" name="Login">
							<img width="24" height="24" src="/themes/adminica/images/icons/small/white/locked_2.png" alt="Locked 2">
							<span>Login</span>
						</button>
						<div class="clear"></div>
					</div>
				</div>

				<?php $this->endWidget(); ?>
			</div>
		</div>
	</div>
</div>